package us.nchu.tomtiger.rowMapper;

import org.springframework.jdbc.core.RowMapper;
import us.nchu.tomtiger.model.Collection;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by XiongXuan on 2018/1/8.
 */
public class CollectionRowMapper implements RowMapper<Collection> {

    @Override
    public Collection mapRow(ResultSet resultSet, int i) throws SQLException {
        Collection collection = new Collection();

        collection.setPhoneNumber(resultSet.getString("phone_number"));
        collection.setProjectId(resultSet.getInt("project_id"));

        return collection;
    }
}
